using System.Collections.Generic;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;

namespace Fines.Powershell.PowershellMSBuildTask.Tests
{
    internal class TestLogger : Logger
    {
        public readonly List<string> Messages = new List<string>();
        public readonly List<string> Errors = new List<string>();
        public readonly List<string> Warnings = new List<string>();


        public override void Initialize( IEventSource eventSource )
        {
            eventSource.MessageRaised += ((sender, args) => Messages.Add(args.Message));

            eventSource.ErrorRaised += ((sender, args) => Errors.Add(args.Message));

            eventSource.WarningRaised += ((sender, args) => Warnings.Add(args.Message));
        }
    }
}
